#if !ENABLE_INPUT_SYSTEM
using UnityEngine;
using UnityEngine.EventSystems;

namespace LS.SimpleInput
{

    public class MouseLeftButtonInputer : MouseButtonInputer
    {
        protected bool m_EventSystemDetected = false;
        public override int InputId => PointerInputModule.kMouseLeftId;
        public override int ButtonIndex => 0;
        public override bool EventSystemDetected => m_EventSystemDetected;

        public MouseLeftButtonInputer(UserInputSetting setting) : base(setting)
        {

        }

        public MouseLeftButtonInputer() : base()
        {

        }

        public override void Update()
        {
            base.Update();
            if (this.Phase == InputPhase.None)
            {
                m_EventSystemDetected = false;
            }
            else
            {
                m_EventSystemDetected = EventSystem.current?.IsPointerOverGameObject(this.InputId) ?? false;
            }
        }
    }

}
#endif
